<?
	layout("/inc/win_layout.html",{title:"统一检索系统",htmlType:"index",pageName:"win_index"}){
?>

<div id="cl-wrapper" class="fixed-menu" style="padding-top: 0px;  ">

    <div class="container-fluid" id="pcont">
        <div class="cl-mcont" >

            <div id="tree" class="ztree" style="width:260px; overflow:auto;"></div>


        </div>
    </div>
</div>
<?}?>

<link rel="stylesheet" href="/js/zTree_v3/css/zTreeStyle/zTreeStyle.css" type="text/css">

<script type="text/javascript" src="/js/zTree_v3/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/js/zTree_v3/js/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript">
    var d = window.parent.getData();
    var id = window.parent.getId();
    var resourceNameEn = window.parent.getNameEn();
    var index = parent.layer.getFrameIndex(window.name);
    var o = d.replace(/@_@/g,"\"");
    $(document).ready(function(){
        var t = $("#tree");
        var setting = {
            view : {
                dblClickExpand : false,
            },
            data : {
                simpleData : {
                    enable : true,
                }
            },
            check : {
                enable : false
            },
            callback : {
                onClick : onClick
            },
        };
        var zNodes = eval(o);
        $.fn.zTree.init($("#tree"), setting, zNodes);
        zTree = $.fn.zTree.getZTreeObj("tree");
        zTree.expandNode(zTree.getNodes()[0], true);
    });
    function loadReady() {
        var bodyH = demoIframe.contents().find("body").get(0).scrollHeight,
            htmlH = demoIframe.contents().find("html").get(0).scrollHeight,
            maxH = Math.max(bodyH, htmlH), minH = Math.min(bodyH, htmlH),
            h = demoIframe.height() >= maxH ? minH:maxH ;
        if (h < 530) h = 530;
        demoIframe.height(h);
    }

    var nameZh;
    var nameEn;
    function onClick(e, treeId, treeNode) {
        classid = treeNode.id;
        nameZh = treeNode.name;
        nameEn = treeNode.value;

    }
    function save() {
        if(nameZh == undefined
            || nameEn == undefined
            || nameZh == null
            || nameEn ==null
            || nameZh == ''
            || nameEn == ''){
            layer.msg("请选择！");
            return ;
        }
        window.parent.$("#tab_"+resourceNameEn).find("#"+id).val(nameEn);
        window.parent.$("#tab_"+resourceNameEn).find("#"+id+"_1").val(nameZh);
        parent.layer.close(index);
    }
</script>